<!---
	* Author: Cristian Costantini 
	* License: http://www.apache.org/licenses/LICENSE-2.0
	 --->
	
<cfcomponent output="false">
    
    <cffunction name="init" access="public" returntype="cacheManagement.factory.CacheFactory" output="false">
        <cfreturn this />
    </cffunction>
    
    <cffunction name="createCacheManager" access="public" returntype="Any" output="false" hint="Create a CacheManager object">
		<cfreturn createInstance("net.sf.ehcache.CacheManager") />
    </cffunction>
    
    <cffunction name="createCache" access="public" returntype="Any" output="false" hint="Create a Cache object">
        <cfreturn createInstance("net.sf.ehcache.Cache") />
    </cffunction>
    
    <cffunction name="createElement" access="public" returntype="Any" output="false" hint="Create an Element object">
        <cfreturn createInstance("net.sf.ehcache.Element") />
    </cffunction>
	
	<cffunction name="createCacheStatistics" access="public" returntype="cacheManagement.util.Statistics" hint="Create a CacheStatistics object">
		<cfargument name="cache" type="Any" required="true" hint="Cache object" />
		<cfreturn createObject( 'component', 'cacheManagement.util.Statistics' ).init( arguments.cache ) />
	</cffunction>
	
	<cffunction name="createEventManager" access="public" returntype="Any" hint="Create an EventManager object">
		<cfreturn createObject( 'component', 'cacheManagement.event.EventManager' ).init() />
	</cffunction>
	
	<cffunction name="createConfigurationFactory" access="public" returntype="Any" hint="Create ConfigurationFactory object">
		<cfreturn createInstance( 'net.sf.ehcache.config.ConfigurationFactory' ) />
	</cffunction>
	
    <!--- private --->
	
	<cffunction name="createInstance" access="private" returntype="Any" output="false">
		<cfargument name="class" type="String" required="true" />
		
		<cfreturn createObject( 'java', arguments.class ) />
		
	</cffunction>
     
</cfcomponent>